<template>
	<view class="  flex flex-column">
		<view class="after-content container pad-b-20">
			<view class="cs-image text-center mar-t-23">
				<image src="@/static/icons/cejg.jpeg"></image>
			</view>
			
			<view class=" bac-color-fff  bac-color-fff  result-content">
				<view class="result-top">您的测评结果</view>
				<view class="result-tile font-size-14 mar-t-20">
					{{ test_info.title || '' }}
				</view>
				<view class="mar-t-10 font-color-333 font-size-12">
					{{ test_info.content || ''}}
				</view>
			</view>
		</view>	
		<clear-line :height="13" :bacColor="'#F4F5FA'"></clear-line>	
		<view class="flex-1 bac-color-fff container pad-t-20 pad-b-20">
			<!-- 推荐咨询师 -->
			<view class=" flex">
				<view class="flex-1">
					<text class="font-size-18 font-bold font-color-222">为您推荐咨询师</text>
				</view>
				<navigator 
				 	url="/pages/consult/index"
					open-type="navigate"
					hover-class="none"  
					>
					<text class="dis-inline-block align-top  font-color-687393" >查看更多 </text>
					<!-- <icon :type="'download'" size="26" /> -->
					<mk-icon :src="''" :height="20" :width="20"></mk-icon>
				</navigator>
			</view>
			<consult-list :range="counsultors"></consult-list>
		</view>
	</view>
</template>

<script>
import consultList from '@/components/consult-list'
import {  getConsultors,testResult } from '@/utils/http'
export default {
	components: {
		consultList
	},
	data(){
		return {
			index_page:0,
			total_page:1,
			counsultors:[],//咨询师列表,
			test_info:'',
		}
	},
	methods:{
		//获取测试结果
		getTestResult(test_id){
			testResult({test_id}).then(res=>{
				if(res){
					this.test_info = res
				}
			})
		},
		getConsultorList(){
			let _that = this;
			getConsultors({page:this.index_page + 1}).then(res=>{
				if(res){
					_that.counsultors = [..._that.counsultors,...res.data]
					_that.index_page = res.current_page;
					_that.total_page = res.last_page;
				}
			})
		},
	},
	onLoad(option){
		this.getTestResult(option.test_id);
		this.getConsultorList();
	}
}
</script>

<style scoped>
.after-content {
	background-image: linear-gradient(#c9e5fd, #c9e5fd);
}
.cs-image image{
	height: 38.5px;
	width: 165px;
}
.result-content{
	margin-top: 20px;
	padding: 20px;
	min-height: 200px;
}
.result-top{
	margin-top: 20px;
	height: 35px;
	line-height: 35px;
	border-left: 4px solid #0088FF;
	padding-left: 5px;
	color: #222;
	font-size: 15px;
	font-weight: 500;
}
.you-result-title::before{
	content: '';

}
</style>